package me.xiaoyan.java.spring.dao;

import me.xiaoyan.java.spring.mapper.AccountMapper;
import me.xiaoyan.java.spring.mapper.UserMapper;
import me.xiaoyan.java.spring.po.Account;
import me.xiaoyan.java.spring.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class AccountDaoImpl implements AccountDao{

    private AccountMapper accountMapper;

    @Autowired
    public void setUserMapper(AccountMapper accountMapper) {
        this.accountMapper = accountMapper;
    }

    @Override
    public void create(Account account) {

    }

    @Override
    public void update(Account account) {

    }

    @Override
    public void delete(Account account) {

    }

    @Override
    public Account findById(Integer id) {
        return accountMapper.selectById(id);
    }

    @Override
    public List<Account> findAll() {
        return accountMapper.selectAll();
    }

    @Override
    public Account findByAccount(String account) {
        return accountMapper.selectByAccount(account);
    }
}
